home *** CD-ROM | disk | FTP | other *** search
/ Especial Multimedia / Especial Multimedia.iso / Multimed / Herra / TIMWIN.ZIP / TESTCFG.CMD < prev    next >
OS/2 REXX Batch file  |  1993-09-22  |  2KB  |  79 lines

  1. ;testcfg  --  test frame grabber configuration
  2. ;
  3. ;  FG_PRESENT       IO_OK     image fg == DIS        conclusion
  4. ;--------------------------------------------------------------------------
  5. ;       0              0            0          0     no framegrabber
  6. ;       0              0            1          1        -
  7. ;       0              1            0          2        -
  8. ;       0              1            1          3        -
  9. ;       1              0            0          4     FG not OK
  10. ;       1              0            1          5     FG not OK 
  11. ;       1              1            0          6     FG OK, but not used
  12. ;       1              1            1          7     FG OK, installed OK
  13. ;
  14. ;Memory tests are only performed if result == 7  (MEM_OK adds 8)
  15. ;Therefore: 7 means: memory write error
  16. ;                15: all OK
  17. ;
  18. ;
  19. ;
  20. #define MEM_OK     8
  21. #define FG_PRESENT 4 
  22. #define IO_OK      2
  23. #define DISP       1
  24.  
  25. #define DIS_IM  0x10
  26.  
  27. parms 
  28.   int report
  29. endparms
  30.  
  31. int sysprop = 0
  32. int imagprop = 0
  33. int orgpix
  34. string result
  35. char textbuf[40]
  36.  
  37.  
  38. imagprop = improp fg
  39. if (imagprop & DIS_IM) == DIS_IM
  40.   sysprop |= DISP
  41.   sysprop |= FG_PRESENT
  42.   if (testio) > 0
  43.      sysprop |= IO_OK
  44.   endif
  45. endif
  46.  
  47. if sysprop == 7         ;continue only if fg is correctly installed
  48.    orgpix = bgm fg 255  ;write a dot into the image and keep prev. value
  49.    if (bgm fg) == 255
  50.       bgm fg 0
  51.       if (bgm fg) == 0
  52.          sysprop |= MEM_OK
  53.       endif
  54.    endif
  55.    bgm fg orgpix           ;write back orig. value
  56. endif
  57.  
  58. if report == 1 stop sysprop  ;keer terug met waarde
  59.         
  60. switch sysprop
  61.   case 0
  62.     result = "No frame grabber present"
  63.   case 4
  64.      result = "Frame grabber error: possible wrong IO address"
  65.   case 5
  66.      result = "Frame grabber error: possible wrong IO address"
  67.   case 6
  68.      result = "Frame grabber is OK, but no FG images defined"
  69.   case 7
  70.      result = "Frame grabber error: possible wrong memory base address"
  71.   case 15
  72.      result = "Frame grabber functions correctly"
  73.   default
  74.      fprint textbuf 0 "Illegal combination of signals:  %xh", sysprop
  75.      result = textbuf
  76. endsw
  77.  
  78. stop result
  79.